* PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for
* the scan routines.
*/
#define PTBEG 0 /* Leave the point at the beginning on search */
#define PTEND 1 /* Leave the point at the end on search */
#define FORWARD 0 /* forward direction */
#define REVERSE 1 /* backwards direction */
#define FIOSUC 0 /* File I/O, success. */
#define FIOFNF 1 /* File I/O, file not found. */
#define FIOEOF 2 /* File I/O, end of file. */
#define FIOERR 3 /* File I/O, error. */
#define FIOMEM 4 /* File I/O, out of memory */
#define FIOFUN 5 /* File I/O, eod of file/bad line*/
#define FIODEL 6 /* Can't delete/rename file */
#define CFCPCN 0x0001 /* Last command was C-P, C-N */
#define CFKILL 0x0002 /* Last command was a kill */
#define BELL 0x07 /* a bell character */
#define TAB 0x09 /* a tab character */
#if V7 | USG | HPUX | BSD
#define PATHCHR ':'
#else
#if WMCS
#define PATHCHR ','
#else
#define PATHCHR ';'
#endif
#endif
#define INTWIDTH sizeof(int) * 3
/* Macro argument token types */
#define TKNUL 0 /* end-of-string */
#define TKARG 1 /* interactive argument */
#define TKBUF 2 /* buffer argument */
#define TKVAR 3 /* user variables */
#define TKENV 4 /* environment variables */
#define TKFUN 5 /* function.... */
#define TKDIR 6 /* directive */
#define TKLBL 7 /* line label */
#define TKLIT 8 /* numeric literal */
#define TKSTR 9 /* quoted string literal */
#define TKCMD 10 /* command name */
/* Internal defined functions */
#define nextab(a) (a - (a % tabsize)) + tabsize
/* DIFCASE represents the integer difference between upper
and lower case letters. It is an xor-able value, which is
fortunate, since the relative positions of upper to lower
case letters is the opposite of ascii in ebcdic.
*/
#ifdef islower
#undef islower
#endif
#ifdef isupper
#undef isupper
#endif
#if ASCII
#define DIFCASE 0x20
#if DIACRIT == 0
#define isletter(c) (('a' <= c && 'z' >= c) || ('A' <= c && 'Z' >= c))
#define islower(c) (('a' <= c && 'z' >= c))
#define isupper(c) (('A' <= c && 'Z' >= c))
#endif
#endif
#if EBCDIC
#define DIFCASE 0x40
#define isletter(c) (('a' <= c && 'i' >= c) || ('j' <= c && 'r' >= c) || ('s' <= c && 'z' >= c) || ('A' <= c && 'I' >= c) || ('J' <= c && 'R' >= c) || ('S' <= c && 'Z' >= c))
#define islower(c) (('a' <= c && 'i' >= c) || ('j' <= c && 'r' >= c) || ('s' <= c && 'z' >= c))
#define isupper(c) (('A' <= c && 'I' >= c) || ('J' <= c && 'R' >= c) || ('S' <= c && 'Z' >= c))
#endif
#if DIACRIT
#define CHCASE(c) chcase(c) /* Toggle extended letter case.*/
#else
#define CHCASE(c) ((c) ^ DIFCASE) /* Toggle the case of a letter.*/
#endif
/* Dynamic RAM tracking and reporting redefinitions */
#if RAMSIZE
#define malloc allocate
#define free release
#endif
/*
* There is a window structure allocated for every active display window. The
* windows are kept in a big list, in top to bottom screen order, with the
* listhead at "wheadp". Each window contains its own values of dot and mark.
* The flag field contains some bits that are set by commands to guide
* redisplay. Although this is a bit of a compromise in terms of decoupling,
* the full blown redisplay is just too expensive to run for every input
* character.
*/
typedef struct WINDOW {
struct WINDOW *w_wndp; /* Next window */
struct BUFFER *w_bufp; /* Buffer displayed in window */
struct LINE *w_linep; /* Top line in the window */
struct LINE *w_dotp; /* Line containing "." */
short w_doto; /* Byte offset for "." */
struct LINE *w_markp[NMARKS]; /* Line containing "mark" */
short w_marko[NMARKS]; /* Byte offset for "mark" */